//=============================================================================
// SentinelArmour - Protects sentinel from a fraction of damage.
//=============================================================================
class SentinelArmour extends SentinelUpgrade;

var() int ArmourAmount;
var() float ProtectionFactor;

function NotifyTakeDamage(out int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType)
{
	local int AbsorbedDamage;

	Super.NotifyTakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);

	AbsorbedDamage = Min(ArmourAmount, Damage * ProtectionFactor);

	Damage -= AbsorbedDamage;
	ArmourAmount -= AbsorbedDamage;

	if(ArmourAmount < 1)
	{
		RemoveUpgrade();
		tfgri(level.game.gamereplicationinfo).control[sentinel.myteam]-=150;
	}
}

defaultproperties
{
     ArmourAmount=300
     ProtectionFactor=0.300000
     AmmoCost=1
     UpgradeName="Armour Plating"
     Description="Constructed from a highly elastic yet hard metal straight from Evil Corp's R&D department, these lightweight armour plates will help to reduce the damage inflicted on your Sentinel. Tests indicate an absorption of approximately 30%.||Internal fitting means the original appearance of your Sentinel is preserved.||The standard deployer is not equipped to repair armour of this category and so it will need to be replaced completely when it finally wears out."
     ActivateSound=Sound'TFMedia.ArmorSnd'
}
